/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #fffdf0;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.hide {
    display: none !important;
}

/* 加载动画 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #cceaf2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    border: 5px solid #99dbd1;
    border-top: 5px solid #7eb3b7;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #7eb3b7;
    font-size: 18px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 聊天室容器 */
.client-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    display: flex;
    height: 100%;
}

/* 左侧边栏 */
.left {
    width: 300px;
    background-color: #7eb3b7;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #99dbd1;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.user {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #99dbd1;
    background-color: #7eb3b7;
    position: relative;
}

.user svg {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    flex-shrink: 0;
}

.user .user-name {
    color: white;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user span {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

/* 搜索容器需要相对定位 */
.search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 搜索结果面板 - 修复跳动问题 */
#search-results-panel {
    position: absolute;
    top: 100%; /* 在搜索框下方 */
    right: 0;  /* 与搜索容器右对齐 */
    width: 280px; /* 固定宽度 */
    max-height: 300px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
    
    /* 关键修复：初始状态就设置好位置，避免跳动 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px); /* 轻微上移，为动画做准备 */
    transition: all 0.2s ease-out;
    
    /* 确保面板不会影响其他布局 */
    pointer-events: none;
}

/* 显示搜索结果面板 - 平滑显示 */
#search-results-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto; /* 恢复交互 */
}

/* 隐藏搜索结果面板 - 平滑隐藏 */
#search-results-panel.hide {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
}

/* 移除之前的display相关样式，避免冲突 */

.search {
    padding: 15px;
    position: relative;
    border-bottom: 1px solid #99dbd1;
}

.search input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #99dbd1;
    background-color: #fffdf0;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search input:focus {
    border-color: #7eb3b7;
    box-shadow: 0 0 0 2px rgba(126, 179, 183, 0.2);
}

.search button {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7eb3b7;
    cursor: pointer;
}

.tab {
    display: flex;
    border-bottom: 1px solid #99dbd1;
}

.tab div {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    color: white;
    font-weight: 500;
    transition: background-color 0.3s;
}

.tab div:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.tab div.active {
    background-color: #99dbd1;
    color: #333;
}

.list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.list li {
    padding: 15px;
    border-bottom: 1px solid #99dbd1;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    color: white;
}

.list li:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.list li.active {
    background-color: #99dbd1;
    color: #333;
}

.list li .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #cceaf2;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7eb3b7;
    font-weight: bold;
}

.list li .info {
    flex: 1;
}

.list li .name {
    font-weight: 600;
    margin-bottom: 5px;
}

.list li .last-message {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右侧聊天区域 */
.right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fffdf0;
}

.title {
    padding: 15px 20px;
    border-bottom: 1px solid #99dbd1;
    background-color: #cceaf2;
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

.message-show {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #fffdf0;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #7a9a9a;
}

.welcome-message i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #7eb3b7;
}

.welcome-message h2 {
    margin-bottom: 10px;
    color: #7eb3b7;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.message.self {
    justify-content: flex-end;
}

.message.other {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message.self .message-bubble {
    background-color: #99dbd1;
    color: #333;
    border-bottom-right-radius: 5px;
}

.message.other .message-bubble {
    background-color: #cceaf2;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message-time {
    font-size: 11px;
    color: #7a9a9a;
    margin-top: 5px;
    text-align: right;
}

.message.other .message-time {
    text-align: left;
}

/* 表情面板 */
.emoji-panel {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    width: 300px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-panel.show {
    display: block;
}

.emoji-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    font-weight: bold;
}

.close-emoji {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

.emoji-container {
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.emoji {
    cursor: pointer;
    font-size: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.emoji:hover {
    background-color: #f0f0f0;
}

/* 消息输入区域 */
.message-input-container {
    padding: 15px;
    border-top: 1px solid #99dbd1;
    background-color: #fffdf0;
    position: relative;
}

.toolbar {
    display: flex;
    margin-bottom: 10px;
}

.tool-btn {
    background: none;
    border: none;
    color: #7eb3b7;
    font-size: 18px;
    margin-right: 15px;
    cursor: pointer;
    transition: color 0.3s;
}

.tool-btn:hover {
    color: #99dbd1;
}

.message-input {
    width: 100%;
    min-height: 60px;
    max-height: 120px;
    padding: 12px 15px;
    border: 1px solid #99dbd1;
    border-radius: 10px;
    resize: none;
    outline: none;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s;
}

.message-input:focus {
    border-color: #7eb3b7;
}

.ctrl {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

#send-btn {
    background-color: #7eb3b7;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

#send-btn:hover:not(:disabled) {
    background-color: #99dbd1;
}

#send-btn:disabled {
    background-color: #cceaf2;
    cursor: not-allowed;
}

/* 上传进度条 */
.upload-progress {
    padding: 10px 15px;
    background-color: #cceaf2;
    border-top: 1px solid #99dbd1;
    display: none;
}

.upload-progress.show {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #fffdf0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background-color: #7eb3b7;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: #7eb3b7;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: white;
    border-radius: 10px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #cceaf2;
    border-bottom: 1px solid #99dbd1;
}

.modal-header h3 {
    color: #333;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: #7eb3b7;
    cursor: pointer;
    font-size: 16px;
}

.modal-body {
    padding: 20px;
}

.search-user {
    display: flex;
    margin-bottom: 15px;
}

.search-user input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #99dbd1;
    border-radius: 20px 0 0 20px;
    outline: none;
}

.search-user button {
    background-color: #7eb3b7;
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
}

.search-results, .friend-requests-list {
    max-height: 300px;
    overflow-y: auto;
}

.user-result, .friend-request {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #cceaf2;
}

.user-result:last-child, .friend-request:last-child {
    border-bottom: none;
}

.user-result .avatar, .friend-request .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #cceaf2;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7eb3b7;
    font-weight: bold;
}

.user-result .info, .friend-request .info {
    flex: 1;
}

.user-result .name, .friend-request .name {
    font-weight: 600;
    margin-bottom: 5px;
}

.user-result .actions, .friend-request .actions {
    display: flex;
    gap: 10px;
}

/* 好友列表激活样式 */
#friend-list li.active {
    background-color: #7a9a9a;
    color: white;
}

#friend-list li.active .avatar {
    background-color: white;
    color: #7a9a9a;
}

#friend-list li.active .status {
    color: rgba(255, 255, 255, 0.8);
}
/* 确保好友列表不显示未读徽章 */
#friend-list .unread-badge {
    display: none !important;
}



/* 通知徽章样式 */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b6b;
    color: white;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.tab-badge {
    display: none !important;
}

/* 好友列表在线状态样式 */
.friend-status {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-top: 2px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-online {
    background-color: #4CAF50;
}

.status-offline {
    background-color: #9e9e9e;
}

.status-away {
    background-color: #ff9800;
}

/* 未读消息徽章样式 */
.unread-badge {
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: auto;
}


/* 响应式调整 */
@media (max-width: 768px) {
    .user-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .action-buttons {
        align-self: flex-end;
    }
}
.unread-badge.hide {
    display: none !important;
}
/* 聊天标题样式 */
.right .title {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}


/* 会话列表激活样式 (确保已存在) */

#session-list li {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #99dbd1;
    cursor: pointer;
    transition: background-color 0.3s;
    color: white;
}

#session-list li .info {
    flex: 1;
    min-width: 0; /* 防止内容溢出 */
}

#session-list li .name {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#session-list li .last-message {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


#session-list li.active {
    background-color: #7a9a9a;
    color: white;
}

#session-list li.active .avatar {
    background-color: white;
    color: #7a9a9a;
}

#session-list li.active .last-message {
    color: rgba(255, 255, 255, 0.9);
}


.btn {
    padding: 5px 10px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.btn-primary {
    background-color: #7eb3b7;
    color: white;
}

.btn-secondary {
    background-color: #cceaf2;
    color: #333;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cceaf2;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #99dbd1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .left {
        width: 250px;
    }
    
    .emoji-container {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 576px) {
    .main {
        flex-direction: column;
    }
    
    .left {
        width: 100%;
        height: 40%;
    }
    
    .right {
        height: 60%;
    }
    
    .emoji-container {
        grid-template-columns: repeat(5, 1fr);
    }
}


/* 搜索结果面板样式 */
.search-results-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #99dbd1;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #cceaf2;
    border-bottom: 1px solid #99dbd1;
    font-weight: 600;
    color: #333;
}

.close-search-results {
    background: none;
    border: none;
    color: #7eb3b7;
    cursor: pointer;
    font-size: 14px;
}

.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #7eb3b7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.search-result-status {
    font-size: 12px;
    color: #7a9a9a;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #7a9a9a;
    font-style: italic;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #7a9a9a;
}

/* 确保搜索框有正确的z-index */
.search {
    position: relative;
    z-index: 101;
}

/* 搜索结果滚动条 */
.search-results-panel::-webkit-scrollbar {
    width: 6px;
}

.search-results-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-results-panel::-webkit-scrollbar-thumb {
    background: #cceaf2;
    border-radius: 3px;
}

.search-results-panel::-webkit-scrollbar-thumb:hover {
    background: #99dbd1;
}

/* 确保搜索结果面板可见的调试样式 */
.search-results-panel:not(.hide) {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 临时添加边框帮助调试 */
.search-results-panel {
    border: 2px solid #7eb3b7 !important; /* 临时调试边框 */
}

/* 修复搜索结果面板位置 */
.search-results-panel {
    position: absolute;
    top: calc(100% + 8px); /* 增加间距，避免被搜索框覆盖 */
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #99dbd1;
    border-radius: 10px; /* 统一圆角 */
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 0;
    
    /* 平滑动画 */
    transition: all 0.3s ease;
    transform-origin: top;
}

/* 面板显示时的动画效果 */
.search-results-panel:not(.hide) {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 确保搜索框容器有足够的空间 */
.search {
    position: relative;
    z-index: 1001;
    margin-bottom: 8px; /* 为面板预留空间 */
}

/* 综合优化方案 */
.search-results-panel {
    position: absolute;
    top: calc(100% + 12px); /* 足够的间距 */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    background: white;
    border: 1px solid #e1f0f2;
    border-radius: 12px;
    box-shadow: 
        0 4px 20px rgba(0,0,0,0.1),
        0 0 0 1px rgba(126, 179, 183, 0.1);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
    
    /* 优雅动画 */
    animation: smoothReveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes smoothReveal {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* 优化搜索框区域，确保有足够空间 */
/* 确保搜索框容器有正确的定位 */
/* 智能面板布局 */
/* 搜索结果面板 - 右侧紧邻但不重叠 */
.search-results-panel {
    position: absolute;
    top: 0; /* 与搜索框顶部对齐 */
    left: 100%; /* 从搜索框右侧开始 */
    margin-left: 5px; /* 很小的间距，不重叠 */
    width: 280px;
    background: white;
    border: 1px solid #e1f0f2;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    
    /* 确保显示 */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    
    /* 平滑动画 */
    transition: all 0.3s ease;
}

/* 面板显示动画 */
.search-results-panel:not(.hide) {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 搜索结果面板样式 */
.search {
    position: relative;
    z-index: 101;
}

.search-results-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #99dbd1;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    /* 确保初始状态是隐藏的 */
    display: none;
}

/* 修复：使用单独的show类来控制显示 */
.search-results-panel.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #cceaf2;
    border-bottom: 1px solid #99dbd1;
    font-weight: 600;
    color: #333;
    border-radius: 8px 8px 0 0;
}

.close-search-results {
    background: none;
    border: none;
    color: #7eb3b7;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-search-results:hover {
    background: rgba(126, 179, 183, 0.1);
}

.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f5f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7eb3b7, #99dbd1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 14px;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    font-size: 14px;
}

.search-result-status {
    font-size: 12px;
    color: #7a9a9a;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #7a9a9a;
    font-style: italic;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #7a9a9a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 移除之前可能冲突的样式 */
.search-results-panel.hide {
    display: none !important;
}


/* 自定义按钮样式 */
.user-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.custom-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.custom-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.custom-btn i {
    font-size: 14px;
}

.btn-text {
    white-space: nowrap;
}

/* 好友请求按钮的特殊样式 - 确保角标位置正确 */
.friend-requests-btn {
    position: relative;
}

/* 红色角标样式 - 固定在右上角 */
.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #7eb3b7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

/* 角标脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 4px rgba(255, 107, 107, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* 隐藏角标 */
.notification-badge.hide {
    display: none !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .user-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .custom-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .btn-text {
        display: none; /* 在小屏幕上隐藏文字，只显示图标 */
    }
    
    .custom-btn i {
        font-size: 16px; /* 增大图标大小 */
    }
}

/* 确保用户区域布局正确 */
.user {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #99dbd1;
    background-color: #7eb3b7;
    position: relative;
    min-height: 70px; /* 确保有足够的高度 */
}

.user svg {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex-shrink: 0;
}

.user .user-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    margin-right: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 搜索容器需要相对定位 */
.search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 搜索结果面板定位调整 */
#search-results-panel {
    position: absolute;
    top: 100%; /* 在搜索框下方 */
    right: 0;  /* 与搜索容器右对齐 */
    width: 280px; /* 固定宽度 */
    max-height: 300px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
    display: none;
    margin-top: 5px; /* 与搜索框的间距 */
}

/* 显示搜索结果面板 */
#search-results-panel.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

/* 隐藏搜索结果面板 */
#search-results-panel.hide {
    display: none;
}

/* 下拉动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜索结果列表样式 */
#search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 搜索结果项样式 */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7eb3b7, #5a9aa0);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-status {
    font-size: 12px;
    color: #7a9a9a;
}

/* 搜索加载状态 */
.search-loading {
    padding: 20px;
    text-align: center;
    color: #7a9a9a;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 无结果状态 */
.no-results {
    padding: 20px;
    text-align: center;
    color: #7a9a9a;
}

/* 搜索结果面板头部 */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.search-results-title {
    font-weight: 600;
    color: #2c3e50;
}

.close-search-results {
    background: none;
    border: none;
    color: #7a9a9a;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-search-results:hover {
    background-color: #e9ecef;
    color: #2c3e50;
}

